package cn.edu.scau.cmi.lixiaoyuan.composite.consistent;

import java.util.Set;



public class Person extends ConsistentOrganization{
    
	private String name;
     
	public int kongge;
	
	  public Person(String name) {
			super();
			this.name = name;
		}

	public int getKongge() {
		return kongge;
	}

	public void setKongge(int kongge) {
		this.kongge = kongge;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
	public ConsistentOrganization addChild(ConsistentOrganization child) {
		System.out.println("对不起，该节点时叶节点，不能添加子节点");
		return this;
	}

	
	public ConsistentOrganization deleteChild(ConsistentOrganization child) {
		System.out.println("对不起，该节点是叶节点，没有子节点可以删除删除");
		return this;
	}
	
	public Set<ConsistentOrganization> getChildren(){
		System.out.println("对不起，该节点是叶节点，没有子节点");
		return null;
	}

	@Override
	public void doSomething() {
		// TODO Auto-generated method stub
		for(int i=0;i<this.getKongge();i++)
			System.out.print("    ");
		
		System.out.println(name);
		
	}

	
	
	
}
